package com.wugui.datax.admin.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wugui.datax.admin.entity.ColumnInfo;
import com.wugui.datax.admin.entity.TableInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;


@Mapper
public interface DBMapper {

    /**
     * 根据数据库名，表名查询记录数
     * @param dbName
     * @param tableName
     * @return
     */
    Long counts(@Param("dbName") String dbName, @Param("tableName") String tableName);

    /**
     * 根据表名查询修改时间
     * @param tableName
     * @return
     */
    // todo
    Timestamp updateTime(@Param("tableName") String tableName);

    IPage<TableInfo> selectPageVo(Page<?> page, String tableName);

    // 根据库名、表名查询字段相关信息
    List<ColumnInfo> selectColumnInfo(@Param("dbName") String dbName, @Param("tableName") String tableName);
}
